package com.web.service.impl;

import com.web.dao.UserDAO;
import com.web.entity.User;
import com.web.service.UserService;

public class UserServiceImpl implements UserService {

    private UserDAO userDAO = new UserDAOImpl();
    @Override
    public User login(String username, String password) {
        User user = userDAO.selectUserByUsername(username);
        if (user != null ) {
            if (user.getPassword().equals(password)) {
                return user;
            }
        }
        return null;
    }
}
